import Layout from '@/layout'

/**
 * 系统菜单路由
 */
const systemRoutes = [

  {
    path: '/home',
    component: Layout,
    children: [{
      path: '/dashboard/home',
      component: () => import('@/views/dashboard/home'),
      name: 'home',
      meta: {
        title: '首页',
        icon: 'dashboard',
        affix: true
      }
    }]
  },
  {
    path: '/documentation',
    component: Layout,
    children: [{
      path: '/documentation/index',
      component: () => import('@/views/documentation/index'),
      name: 'Documentation',
      meta: {
        title: '文档',
        icon: 'documentation',
        noCache: true
      }
    }]
  },
  {
    path: '/guide',
    component: Layout,
    redirect: '/guide/index',
    children: [{
      path: '/guide/index',
      component: () => import('@/views/guide/index'),
      name: 'Guide',
      meta: {
        title: '指南',
        icon: 'guide',
        noCache: true
      }
    }]
  },
  {
    path: '/profile',
    component: Layout,
    redirect: '/profile/index',
    hidden: true,
    children: [{
      path: '/profile/index',
      component: () => import('@/views/profile/index'),
      name: 'Profile',
      meta: {
        title: '配置文件',
        icon: 'user',
        noCache: true
      }
    }]
  },

  {
    path: '/example',
    component: Layout,
    redirect: '/example/table',
    name: 'Example',
    meta: {
      title: 'Example',
      icon: 'el-icon-s-help'
    },
    children: [{
        path: '/example/table',
        name: 'Table',
        component: () => import('@/views/table/index'),
        meta: {
          title: 'Table',
          icon: 'table'
        }
      },
      {
        path: '/example/tree',
        name: 'Tree',
        component: () => import('@/views/tree/index'),
        meta: {
          title: 'Tree',
          icon: 'tree'
        }
      }
    ]
  },

  {
    path: '/form',
    component: Layout,
    children: [{
      path: '/form/index',
      name: 'Form',
      component: () => import('@/views/form/index'),
      meta: {
        title: 'Form',
        icon: 'form'
      }
    }]
  },


  {
    path: '/error',
    component: Layout,
    redirect: 'noRedirect',
    name: 'ErrorPages',
    meta: {
      title: '错误页面',
      icon: '404'
    },
    children: [{
        path: '/error/401',
        component: () => import('@/views/error-page/401'),
        name: 'Page401',
        meta: {
          title: '401',
          noCache: true
        }
      },
      {
        path: '/error/404',
        component: () => import('@/views/error-page/404'),
        name: 'Page404',
        meta: {
          title: '404',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/error-log',
    component: Layout,
    children: [{
      path: '/error-log/log',
      component: () => import('@/views/error-log/index'),
      name: 'ErrorLog',
      meta: {
        title: '错误日志',
        icon: 'bug'
      }
    }]
  },
  {
    path: 'external-link',
    component: Layout,
    children: [{
      path: 'https://github.com/PanJiaChen/vue-element-admin',
      meta: {
        title: 'External Link',
        icon: 'link'
      }
    }]
  },

]

export default systemRoutes
